﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Antioch.Base
{
    [Jemgine.Engine.Category("Antioch System"), Jemgine.Engine.Node]
   public class PlayerOnly: Jemgine.Data.ScriptNode
    {
       public PlayerOnly()
       {
           AddInput("In", null);
           AddOutput("Out", null);
       }

       public override void FireTerminal(int InputID, Jemgine.Data.ScriptPayload Payload)
       {
           GameStateModule GameState = Sim.GetModule<GameStateModule>();
           if (GameState != null && Payload.SenderRef == GameState.Player)
               OutputTerminals[0].Fire(Payload);
       }      
    }
}
